package abstractfactory.factory.impl;

import abstractfactory.factory.Factory;
import abstractfactory.item.color.impl.Blue;
import abstractfactory.item.color.Color;
import abstractfactory.item.color.impl.Green;
import abstractfactory.item.color.impl.Red;

public class ColorFactory extends Factory {
    public Color getColor(String color){
        if(color == null){
            return null;
        }
        if(color.equalsIgnoreCase("red")){
            return new Red();
        } else if(color.equalsIgnoreCase("green")){
            return new Green();
        } else if(color.equalsIgnoreCase("blue")){
            return new Blue();
        }
        return null;

    }

}
